<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page import="com.turing.selfwebservice.common.OptimalPageControl;"%>
<%
	String path = request.getContextPath();
%>
<script language="JavaScript" type="text/JavaScript">
function jumping(servletPath, pageNo) {
	if (null == pageNo) {
		pageNo = document.getElementById("pageNumber").value;
	}
	location.replace(servletPath + "&pageNo=" + pageNo);
}
</script>
<%
	int curPage = 0;
	int totalPage = 0;
	int totalCount = 0;
	int pageSize = 15;
	OptimalPageControl pageInfo = (OptimalPageControl) request
			.getAttribute("pageInfo");
	if (pageInfo != null) {
		curPage = pageInfo.getCurrentPageNO();
		totalPage = pageInfo.getMaxPageNO();
		totalCount = pageInfo.getMaxRowCount();
		pageSize = pageInfo.getPageSize();
	}
	String servletPath = (String) request.getAttribute("servletPath");
%>
<table width="100%" cellspacing="0" cellpadding="0" class="noauto pageControl">
	<%
		//如果没信息
		if (totalPage == 0) {
	%>
	<tr class="tr006">
		<td align="center" class="fContent">
			<span>第</span>
			<font color="#FF0000">0/0</font>
			<span>页</span>
			
			<span>共</span>
			<font color="#FF0000">0</font>
			<span>条</span>
			<img src="<%=path %>/images/rms-button-first.gif" width="41" height="19" hspace="5" border="0">
				
			<img src="<%=path %>/images/rms-button-pageup.gif" width="41" height="19" hspace="5" border="0">
				
			<img src="<%=path %>/images/rms-button-pagedown.gif" width="41" height="19" hspace="5" border="0">
				
			<img src="<%=path %>/images/rms-button-last.gif" width="41" height="19" hspace="5" border="0">
				
			
			<SELECT name="pageNumber" onchange="jumping()">
				<OPTION selected value=0>
					0
				</OPTION>
			</SELECT>
			<span>页</span>
		</td>
	</tr>
	<%
		//有信息
		} else {
	%>
	<tr class="tr006">
		<td align="center" class="fContent">
			<span>第</span>
			<font color="#FF0000"><%=curPage%>/<%=totalPage%></font>
			<span>页</span> 
			<span>共</span>
			<font color="#FF0000"><%=totalCount%></font>
			<span>条</span>
			<%
 	if (curPage == 1) {
 %>
			<img src="<%=path %>/images/rms-button-first.gif" width="41" height="19"
				hspace="5" border="0">
			<img src="<%=path %>/images/rms-button-pageup.gif" width="41" height="19"
				hspace="5" border="0">
			<%
				} else {
			%>
			<a href="javascript:jumping('<%=servletPath%>',1)" class="fContent"><img
					src="<%=path %>/images/rms-button-first.gif" width="41" height="19" hspace="5"
					border="0"> </a>
			<a href="javascript:jumping('<%=servletPath%>','<%=curPage - 1%>')"
				class="fContent"><img src="<%=path %>/images/rms-button-pageup.gif"
					width="41" height="19" hspace="5" border="0"> </a>
			<%
				}
					if (curPage == totalPage) {
			%>
			<img src="<%=path %>/images/rms-button-pagedown.gif" width="41" height="19"
				hspace="5" border="0">
			<img src="<%=path %>/images/rms-button-last.gif" width="41" height="19"
				hspace="5" border="0">
			<%
				} else {
			%>
			<a href="javascript:jumping('<%=servletPath%>','<%=curPage + 1%>')"
				class="fContent"><img src="<%=path %>/images/rms-button-pagedown.gif"
					width="41" height="19" hspace="5" border="0"> </a>
			<a href="javascript:jumping('<%=servletPath%>','<%=totalPage%>')"
				class="fContent"><img src="<%=path %>/images/rms-button-last.gif"
					width="41" height="19" hspace="5" border="0"> </a>
			<%
				}
			%>
			<span>跳转</span>
			<SELECT name="pageNumber" id="pageNumber"
				onchange="jumping('<%=servletPath%>',pageNumber.value);">
				<%
					for (int i = 1; i <= totalPage; i++) {
							if (i == curPage) {
				%>
				<OPTION selected value=<%=i%>><%=i%></OPTION>
				<%
					} else {
				%>
				<OPTION value=<%=i%>><%=i%></OPTION>
				<%
					}
						}
				%>
			</SELECT>
	</tr>
	<%
		}
	%>
</table>
